import request from '@/utils/request'

// 查询高频面试题列表
export function listInterview(query) {
    return request({
        url: '/teaching/interview/list',
        method: 'get',
        params: query
    })
}

// 查询高频面试题详细
export function getInterview(id) {
    return request({
        url: '/teaching/interview/' + id,
        method: 'get'
    })
}

// 新增高频面试题
export function addInterview(data) {
    return request({
        url: '/teaching/interview',
        method: 'post',
        data: data
    })
}

// 修改高频面试题
export function updateInterview(data) {
    return request({
        url: '/teaching/interview',
        method: 'put',
        data: data
    })
}

// 删除高频面试题
export function delInterview(id) {
    return request({
        url: '/teaching/interview/' + id,
        method: 'delete'
    })
}


// 导出es
export function exportEs() {
    return request({
        url: '/teaching/interview/exportEs',
        method: 'put'
    })
}

export function queryExportEsProgress() {
    return request({
        url: '/teaching/interview/exportEs/progress',
        method: 'get'
    })
}


// 查询相关面试题
export function queryRelatedInterview(courseDesignId, courseContent) {
    return request({
        url: '/teaching/interview/relatedInterview',
        method: 'get',
        params: {
            courseDesignId,
            courseContent
        }
    })
}

// 根据关键词查询面试题
export function queryRelatedInterviewByKeywords(keywords) {
    return request({
        url: '/teaching/interview/relatedByKeywords',
        method: 'post',
        data: keywords
    })
}

// 保存课程设计与面试题的关联关系
export function saveRelatedInterview(courseDesignId, interviewIds) {
    return request({
        url: '/teaching/interview/saveRelated',
        method: 'post',
        data: {
            courseDesignId: courseDesignId,
            interviewIds: interviewIds
        }
    });
}
